-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
e1037f4
to
d1aa87e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job with the documentation, just left a few minor comments for you to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finished my first review.
It is a big PR.
I did not have too much time to check the GitHub API document in details one by one, which means I may miss some details.
So, please help me do 2 things
- Please let me know if there is something concerning you that you hope others can re-confirm. This is including
- The parts you want to make your code cleaner.
- The parts you hope others to check the doc as well. And, please attach the doc url.
- The parts you are afraid that will increase the code maintenance in the future
- ....
- Please build several pipelines to make sure your Tasks solid & robust locally.
- To avoid the duplicate work, you can save the recipe and to upload d0/staging in the future. (I am not so sure if we support this function now, and I will also check this part)
"TASK_GET_REVIEW_COMMENTS", | ||
"TASK_CREATE_REVIEW_COMMENT", | ||
"TASK_GET_ALL_ISSUES", | ||
"TASK_GET_ISSUE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question
"TASK_GET_ALL_PULL_REQUESTS",
"TASK_GET_PULL_REQUEST",
"TASK_GET_ALL_ISSUES",
"TASK_GET_ISSUE",
I am curious about the purpose of the design here.
If we remain multiple one, will it be cleaner in terms of UX / codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I make tasks to get a specific pr/issue to simplify the response. If the client can only use multiple ones, they may need to use another component to filter out the response they want and make the pipeline more complex.
Moreover, some detailed information may not be provided in the multiple ones' responses. The purpose of build "get all" here is to provide a tool for users to know what pr/issue the repo has if they don't know the pr/issue number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can combine the two multiple tasks into a "TASK_GET_REPO_INFO" and return all the info users might want to know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can combine the two multiple tasks into a "TASK_GET_REPO_INFO" and return all the info users might want to know?
I think your original way will be fine!
Aligning the vendors could bring as benefit in terms of workflow use case in my opinion.
It may be too various to know what users want to know in the cases of workflow because every company has different flows even when there are best practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @YCK1130 @chuang8511
Let's use LIST
instead of GET_ALL
, as it's a more typical name when listing the data.
"TASK_GET_ALL_PULL_REQUESTS"
->TASK_LIST_PULL_REQUESTS
"TASK_GET_ALL_ISSUES"
->TASK_LIST_ISSUES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
One more thing, there are page, page_number options to determine how many items would be returned, should I include these in the field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I think we should add it. You can open another PR to include it later.
Concerns about this component
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
second draft review.
I will check in details next week.
"TASK_GET_REVIEW_COMMENTS", | ||
"TASK_CREATE_REVIEW_COMMENT", | ||
"TASK_GET_ALL_ISSUES", | ||
"TASK_GET_ISSUE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can combine the two multiple tasks into a "TASK_GET_REPO_INFO" and return all the info users might want to know?
I think your original way will be fine!
Aligning the vendors could bring as benefit in terms of workflow use case in my opinion.
It may be too various to know what users want to know in the cases of workflow because every company has different flows even when there are best practices.
"TASK_GET_REVIEW_COMMENTS", | ||
"TASK_CREATE_REVIEW_COMMENT", | ||
"TASK_GET_ALL_ISSUES", | ||
"TASK_GET_ISSUE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @YCK1130 @chuang8511
Let's use LIST
instead of GET_ALL
, as it's a more typical name when listing the data.
"TASK_GET_ALL_PULL_REQUESTS"
->TASK_LIST_PULL_REQUESTS
"TASK_GET_ALL_ISSUES"
->TASK_LIST_ISSUES
return &base.ExecutionWrapper{Execution: e}, nil | ||
} | ||
|
||
func (e *execution) fillInDefaultValues(input *structpb.Struct) (*structpb.Struct, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YCK1130 @chuang8511
How about let's move this function to the base
package and make it available for all components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good idea. However, there are some concerns described in the Slack.
"github.com/instill-ai/x/errmsg" | ||
) | ||
|
||
func middleWare(req string) int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for the mock server to throw errors across various tasks.
type MockIssuesService struct{} | ||
|
||
func (m *MockIssuesService) ListByRepo(ctx context.Context, owner, repo string, opt *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error) { | ||
switch middleWare(owner) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can the owner string be converted to an HTTP code?
73b2674
to
0b36264
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update all property keys to kebab-case.
c3a4c05
to
6d9bdca
Compare
- We need a GitHub component to complete some development automation tasks instill-ai/instill-core#1025 - [X] TASK_GET_ALL_PULL_REQUESTS: function to get all prs given owner name and repository name. - [X] TASK_GET_PULL_REQUEST: function to get a specific pr given owner name, repository name, and pr number. (including file changes) - [X] TASK_GET_REVIEW_COMMENT: get review comment inside a pull request - [X] TASK_CREATE_REVIEW_COMMENT: create review comment inside a pull request - [X] TASK_GET_COMMIT: get commit messages and file changes - [x] TASK_CREATE_ISSUE: post issue - [x] TASK_GET_ALL_ISSUES: get all issues in a repo - [x] TASK_GET_ISSUE: get an issue - [x] TASK_CREATE_WEBHOOK: register webhook, https://docs.github.com/en/webhooks/webhook-events-and-payloads
🤖 I have created a release *beep* *boop* --- ## [0.22.0-beta](v0.21.0-beta...v0.22.0-beta) (2024-07-16) ### Features * add GitHub component ([#177](#177)) ([46e5a8e](46e5a8e)) * add JQ input field that accepts any type ([#201](#201)) ([cba4aac](cba4aac)) * **cohere:** add Cohere component ([#187](#187)) ([63fd578](63fd578)) * **cohere:** add cohere to be able to use instill credit ([#213](#213)) ([80415b1](80415b1)) * GitHub component pagination ([#212](#212)) ([4b8bbc7](4b8bbc7)) * **instill:** send requester UID, if present, on model trigger ([#202](#202)) ([31422cd](31422cd)) * **mistral:** add Mistral AI component ([#204](#204)) ([12aaf4f](12aaf4f)) * **openai:** add dimensions in openai component ([#200](#200)) ([0d08912](0d08912)) * **text:** add input and output and fix bugs ([#209](#209)) ([56ab3eb](56ab3eb)) * unify pipeline and component usage handlers ([#197](#197)) ([e27e46c](e27e46c)) ### Bug Fixes * fix instillUpstreamTypes not correctly render the JSON schema ([#216](#216)) ([bb603bd](bb603bd)) * **mistralai:** svg naming is wrong ([#218](#218)) ([108817a](108817a)) * **text:** hotfix the bug from langchaingo without importing the function o… ([#217](#217)) ([4cfc263](4cfc263)) * typo ([#195](#195)) ([d6b2a42](d6b2a42)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Because
This commit
Related Issue
instill-ai/instill-core#1025
Todo